package com.tanhua.server.service;

import com.tanhua.dubbo.api.mongo.UserLocationApi;
import com.tanhua.model.mongo.UserLocation;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * 地理位置上报业务处理
 */
@Service
public class BaiduService {

    @DubboReference
    private UserLocationApi userLocationApi;

    /**
     * 上报地理位置
     */
    public void reportLocation(Double longitude, Double latitude, String addrStr) {
        //测试：UserLocation对象GeoJsonPoint封装对象进行传输会出现序列化异常
        userLocationApi.save(UserHolder.getUserId(),longitude,latitude,addrStr);
    }
}
